package com.mini.constant;

public enum KantHttpStatus {

    http_200(200,"成功返回"),
    http_401(401,"未授权"),
    http_403(403,"无操作权限"),
    http_404(404,"请求的资源不存在"),
    http_500(500,"服务繁忙"),
    http_601(601,"操作失败"),
    http_603(603,"资源不存在"),
    http_611(611,"请求参数有误，请参照文档检查"),
    http_612(612,"用户获取微信 openid 异常"),
    http_613(613,"用户初始化异常"),
    http_614(614,"商品不存在/未匹配到集团商品"),
    http_615(615,"您已购买该商品，请勿重复购买"),
    http_616(616,"系统订单创建失败"),
    http_617(617,"暂不支持该渠道下单"),
    http_618(618,"操作频繁，请稍后再试"),
    http_619(619,"班次不存在"),
    http_620(620,"学员已在目标班次中，不可再次分班"),
    http_621(621,"学员无待分班数据，不可分班"),
    http_622(622,"学员不在原班级中，不可分班"),
    http_623(623,"班次分属不同的教学计划，不可分班"),
    http_624(624, "待分班订单对应的学员已在此班次中，不可再次分班")
    ;

    private int code;
    private String msg;

    KantHttpStatus(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }


    public static KantHttpStatus getByCode(int code){
        for(KantHttpStatus status : KantHttpStatus.values()){
            if(status.getCode() == code){
                return status;
            }
        }

        return null;
    }
}
